package com.zr.serviceimpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zr.dao.CarIDDao;
import com.zr.model.Ccarinfo;
import com.zr.service.CarIDService;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Service("cidseim")
public class CarIDServiceImpl implements CarIDService{
	@Resource
	private CarIDDao ciddim;
	@Override
	public JSONArray getCar() {
		
		JSONArray ja=new JSONArray();
		List<Ccarinfo> li=ciddim.findCnumber();
			for (Ccarinfo c : li) {
				JSONObject jo=new JSONObject();
				jo.put("id", c.getCid());
				jo.put("text", c.getCnumber());
				ja.add(jo);
			}
			
		return ja;
	}

}
